package com.numberone.service.impl;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.core.toolkit.support.SFunction;
import com.numberone.entity.Check;
import com.numberone.entity.User;
import com.numberone.mapper.CheckMapper;
import com.numberone.service.ICheckService;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * <p>
 *  服务实现类
 * </p>
 *
 * @author zzc
 * @since 2019-04-12
 */
@Service
public class CheckServiceImpl extends ServiceImpl<CheckMapper, Check> implements ICheckService {

    @Autowired
    private CheckMapper checkMapper;

    @Override
    public void addCheck (Check checkFormMap){
        checkMapper.insert(checkFormMap);
    }

    @Override
    public int delete (String id){
        return checkMapper.deleteById(id);
    }

    @Override
    public Check findCheckById(String datainfo){
        return checkMapper.selectById(datainfo);
    }

    @Override
    public void update(Check checkFormMap){
        checkMapper.updateById(checkFormMap);
    }

    @Override
    public List<Check> find(String name , String value){
        QueryWrapper<Check> queryWrapper = new QueryWrapper<>();
        queryWrapper.eq(name, value);
        return list(queryWrapper);
    }
}
